import { defineConfig, normalizePath } from 'vite'
import react from '@vitejs/plugin-react';
import path from 'path'
console.log(path.resolve(__dirname, 'src'))
const variablePath = normalizePath(path.resolve('./src/variable.scss'))
// https://vitejs.dev/config/
export default defineConfig({
  root: path.resolve(__dirname, 'src'),
  plugins: [react()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "${variablePath}";`
      }
    }
  },
  resolve: {
    // 别名配置
    alias: {
      '@assets': path.join(__dirname, 'src/assets')
    }
  },
  optimizeDeps: {
    include: [
      "object-assign",
      "@loadable/component > hoist-non-react-statics",
    ],

  }
})
